modular dotfiles in nix
nixでmoduler dotfilesをやる
つまり、dotfilesをnixで管理する
github
home-managerをFlakesで使う
features
home-manager
様々なpackageをglobalで一律で管理できる
また、その設定ファイルもnixのものとして書ける
nix-darwin
macのシステム設定をnixで管理できる
Just
モダンなMake
dotfiles自体のinstall時などに使う
nix-direnv
様々なpackageをlocalで一律に管理するときに嬉しい
install
READMEに書いてる
構成の順序問題をどうにか解決している
just, nix, ghqらへんをどれも最初に入れたくなってしまう
最初にこのrepoをcloneする際に、決まった場所に置かないといけない
後のghq rootとなる場所
justで実行してnixなどをinstallする際に、sym linkなどをそこにめがけて実行することになるから。
追加方法
nix/hoge/default.nixを追記
入れるだけで特に設定が不要なものはnix/utils/default.nixに追記する
無意味にdirを切っていくのがめんどいのもある
設定を書きたくなってからdirを切っていけばいい
home.nixにpathを追記
こちらはこんな風に書けば、自動化できるのだが
「今必要なやつだけを使用する状態にしたい」とか、「会社のPCではpursは不要だし..」とかに対応できるようにするために手動で設定するようにしたmrsekut.icon
home-managerでVSCodeの設定をすることもできるらしいが、あまりメリットを感じないのでしてないmrsekut.icon
settings.jsonをsym link貼ったほうがらく
VSCodeの設定をdotfilesで管理するでいく
todos
darwinもっと書く
nixpkgsをpinしないと、nixやhome-managerのinstall時に失敗することがある
just nix-installのコマンド内をどうにかしないといけない
最初の設定時に引っかかったやつとか
$HOMEや$USERはベタ書きではなくこの変数を使う
使っているPCごとにuser名が違ってるとerrorになる
既存に.zshrcとかがあるとerrorになる
移動してねと言われる
まぁでもこれはjustで勝手にやることではないだろうし仕方ないかmrsekut.icon
code:a
I back up shell profile/rc scripts before I add Nix to them.
I need to back up /etc/zshrc to /etc/zshrc.backup-before-nix,
but the latter already exists.
Here's how to clean up the old backup file:
1. Back up (copy) /etc/zshrc and /etc/zshrc.backup-before-nix
to another location, just in case.
2. Ensure /etc/zshrc.backup-before-nix does not have anything
Nix-related in it. If it does, something is probably quite
wrong. Please open an issue or get in touch immediately.
3. Once you confirm /etc/zshrc is backed up and
/etc/zshrc.backup-before-nix doesn't mention Nix, run:
mv /etc/zshrc.backup-before-nix /etc/zshrc
We'd love to help if you need it.
You can open an issue at https://github.com/nixos/nix/issues
Or feel free to contact the team:
- Matrix: #nix:nixos.org
- IRC: in #nixos on irc.libera.chat
- twitter: @nixos_org
- forum: https://discourse.nixos.org
GitHubを2要素認証にしたので、もしかしたら引っかかるかも..
Please make sure you have the correct access rights and the repository exists.
この辺読んだらいけた
これだけ読んでいけるかは謎
急いでやりすぎてどれでうまく行ったのかわからん感じになった
できるだけ最近の記事を読むようにしたほうがいい
githubの仕様が変わっているのでイライラする
設定にicon(font)が入っていないので、starshipが「?」になるなmrsekut.icon
nix-darwinか?